package com.lv.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author 凉薄
 * @since 2022-01-21
 */
@Getter
@Setter
public class Good implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 商品id [no]
     */
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using= ToStringSerializer.class)
    private Long goodId;

    /**
     * 商品名称 [text]
     */
    private String goodName;

    /**
     * 剩余库存 [num]
     */
    private Integer inventory;

    /**
     * 商品价格 [num]
     */
    private BigDecimal price;

    /**
     * 父类id 0为顶级目录
     */
    private Long parentId;

    @TableField(exist = false)
    private List<Good> children;
}
